<template>
	<view class="uni_box home">
		<navbar title='我的题库' :yin="true">
			<view class="hright" slot="right">
				<image class="tzhi" src="@/pages_subject/static/img/tzhi.png" mode="" />
			</view>
		</navbar>
		<view class="content">
			<view class="tione" v-if="top" @click="navClick(7)">
				<image class="zuoti" :src="top.image" mode="" />
				<view class="zuoview">
					{{top.button_text}}
				</view>
			</view>
			<view class="titwo">

				<view class="tiitem" v-for="(item,index) in list" :key="index" @click="navtwoClick(item)">
					<view class="tiimgview" :style="{
							background:item.background
						}">
						<image class="tiicon" :src="item.image" mode="" />
					</view>
					<text class="moname">{{item.name}}</text>
				</view>

				<!-- <view class="tiitem" @click="navClick(1)">
					<view class="tiimgview">
						<image class="tiicon" src="@/pages_subject/static/img/tione.png" mode="" />
					</view>
					<text class="moname">模拟试卷</text>

				</view>
				<view class="tiitem" @click="navClick(2)">
					<view class="tiimgview" style="background: #EFFBF4;">
						<image class="tiicon" style="width: 29rpx;height: 35rpx;" src="@/pages_subject/static/img/titwo.png" mode="" />
					</view>
					<text class="moname">我的错题</text>

				</view>
				<view class="tiitem" @click="navClick(3)" style="margin-right: 0;">
					<view class="tiimgview" style="background: #EAF4FF;">
						<image class="tiicon" src="@/pages_subject/static/img/tithree.png" mode="" />
					</view>
					<text class="moname">我的提问</text>

				</view>
				<view class="tiitem" @click="navClick(4)">
					<view class="tiimgview" style="background: #FFF5EE;">
						<image class="tiicon" src="@/pages_subject/static/img/tithrees.png" mode="" />
					</view>
					<text class="moname">我的收藏</text>

				</view>
				<view class="tiitem" @click="navClick(5)">
					<view class="tiimgview" style="background: #EFFBF4;">
						<image class="tiicon" src="@/pages_subject/static/img/tifour.png" mode="" />
					</view>
					<text class="moname">能力评估</text>

				</view>
				<view class="tiitem" @click="navClick(6)" style="margin-right: 0;">
					<view class="tiimgview" style="background: #EFFBF4;">
						<image class="tiicon" src="@/pages_subject/static/img/tifour.png" mode="" />
					</view>
					<text class="moname">做题记录</text>

				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				test_id:'1',//试卷id 
				combo_id:"1",
				list:[],
				top:{}
			}
		},
		onLoad(option) {
			if(option.test_id){
				this.test_id = option.test_id
			}
			if(option.combo_id){
				this.combo_id = option.combo_id
			}
			this.getMyTiku()
		},
		onShow() {
		},
		methods: {
			async getMyTiku(){
				let res = await this.$u.api.getMyTiku({
					combo_id:this.combo_id
				});
				this.list = res.list
				this.top = res.top
			},
			navClick(e){
				if(e == 1){
					//模拟试卷
					this.navrouter("/pages_subject/twoPage/TiPage/TiKaoshi?test_id="+this.test_id);
				}else if (e == 2){
					//我的错题
					// this.navrouter("/pages_subject/twoPage/TiPage/TiCuowu");
					this.navrouter("/pages_subject/twoPage/TiPage/CuotiLx");
				}else if (e == 3){
					//我的提问
					this.navrouter("/pages_subject/twoPage/TiPage/MyTiwen");
				}else if (e == 4){
					//我的收藏
					this.navrouter("/pages_subject/twoPage/TiPage/TiShouCang");
				}else if (e == 5){
					//能力评估
					this.navrouter("/pages_subject/twoPage/TiPage/NengPinggu");
				}else if (e == 6){
					//做题记录
					this.navrouter("/pages_subject/twoPage/TiPage/TiRecord");
				}else if (e == 7){
					//继续做题
					// this.navrouter("/pages_subject/twoPage/TiPage/Tilist");
					this.navrouter("/pages_subject/twoPage/TiPage/ZhikeLx?combo_id="+this.combo_id);
				}
			},
			navtwoClick(item){
				this.toPage(item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.content{
		background-color: #fff;
		// padding-bottom: 150rpx;
		.tione{
			margin: 45rpx;
			position: relative;
			height: 203rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			.zuoti{
				position: absolute;
				width: 100%;
				height: 100%;
			}
			.zuoview{
				width: 194rpx;
				height: 47rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: auto;
				color: rgba(253, 134, 79, 1);
				font-size: 30rpx;
				position: relative;
				z-index: 2;
				background-color: #fff;
				border-radius: 50rpx;
				margin-right: 50rpx;
			}
		}
		.titwo{
			margin: 30rpx;
			padding: 30rpx 20rpx 10rpx;
			background: #F6F7FB;
			border-radius: 20rpx;
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			justify-content: center;
			.tiitem{
				width: 31%;
				margin-right: 2%;
				height: 179rpx;
				background: #FFFFFF;
				border-radius: 10rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				margin-bottom: 20rpx;
				.tiimgview{
					width: 64rpx;
					height: 64rpx;
					background: #FFF8E2;
					border-radius: 50%;
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: center;
				}
				.tiicon{
					width: 32rpx;
					height: 32rpx;
				}
				.moname{
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #555555;
					display: block;
					margin-top: 10rpx;
				}
			}
		}
	}
	.tzhi{
		width: 25rpx;
		height: 28rpx;
	}
</style>
